/**
 * 
 */
package com.newworld.dmsapp2.util;

import java.io.File;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

import org.json.JSONObject;
import org.litepal.crud.DataSupport;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.media.MediaPlayer;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.newworld.dmsapp2.R;
import com.newworld.dmsapp2.activity.MainActivity;
import com.newworld.dmsapp2.activity.ServiceScheduleActivity;
import com.newworld.dmsapp2.bean.InitOperation;
import com.newworld.dmsapp2.bean.InitProgressFunction;
import com.newworld.dmsapp2.bean.InitTaskState;
import com.newworld.dmsapp2.bean.Task;
import com.newworld.dmsapp2.bean.User;
import com.newworld.dmsapp2.bean.UserAccount;
import com.newworld.dmsapp2.ui.view.CustomLoadingDialog;

/**
 * 所有公共方法放在这个类里
 * 
 * @author
 * 
 */

public class Tool {

	/**
	 * 这个方法把json解析为List<Map<String, String>><br>
	 * 只能是纯jsonArray或jsonObject
	 * 
	 * @param jsonData
	 * @return List<Map<String, String>>
	 */
	// public static List<Standard> noFouthItemsSecondStandards = new
	// ArrayList<Standard>();

	public static List<Map<String, String>> praseFromJosn(String jsonData) {
		Type ListType = new TypeToken<ArrayList<Map<String, String>>>() {
		}.getType();
		Gson gson = new Gson();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		list = gson.fromJson(jsonData, ListType);
		return list;

	}

	public static void setNetwork(final Context context) {
		AlertDialog.Builder builder = new AlertDialog.Builder(context);
		builder.setIcon(android.R.drawable.ic_dialog_alert);
		builder.setTitle(R.string.tool_netstate);
		builder.setMessage(R.string.tool_setnetwork);
		builder.setPositiveButton(R.string.tool_ok,
				new DialogInterface.OnClickListener() {

					@Override
					public void onClick(DialogInterface dialog, int which) {
						Intent intent;

						if (android.os.Build.VERSION.SDK_INT > 10) {
							intent = new Intent(
									android.provider.Settings.ACTION_SETTINGS);
						} else {
							intent = new Intent(
									android.provider.Settings.ACTION_WIRELESS_SETTINGS);
						}

						context.startActivity(intent);
					}
				});
		builder.setNegativeButton(R.string.tool_cancel,
				new DialogInterface.OnClickListener() {

					@Override
					public void onClick(DialogInterface dialog, int which) {
						dialog.cancel();
					}
				});
		builder.create();
		builder.show();
	}

	/**
	 * 联网前用的，确认手机是否联网
	 * 
	 * @param Context
	 * @return
	 * @author
	 */
	public static boolean isNetworkAvailable(Context context) {

		ConnectivityManager connect = (ConnectivityManager) context
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		if (null == connect) {
			return false;
		} else {
			NetworkInfo[] info = connect.getAllNetworkInfo();
			if (null != info) {
				for (int i = 0; i < info.length; i++) {
					if (info[i].getState() == NetworkInfo.State.CONNECTED) {
						return true;
					}
				}
			}
		}
		return false;
	}

	public static boolean isWifi(Context context) {// 判断是否为WIFI
		ConnectivityManager connectivityManager = (ConnectivityManager) context
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
		if (activeNetInfo != null
				&& activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI
				&& activeNetInfo.isAvailable()) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * 验证手机格式
	 */
	public static boolean isMobileNO(String mobiles) {
		/*
		 * 移动：134、135、136、137、138、139、150、151、157(TD)、158、159、187、188
		 * 联通：130、131、132、152、155、156、185、186 电信：133、153、180、189、（1349卫通）
		 * 总结起来就是第一位必定为1，第二位必定为3或5或8，其他位置的可以为0-9
		 */
		String telRegex = "[1][358]\\d{9}";// "[1]"代表第1位为数字1，"[358]"代表第二位可以为3、5、8中的一个，"\\d{9}"代表后面是可以是0～9的数字，有9位。
		if (TextUtils.isEmpty(mobiles))
			return false;
		else
			return mobiles.trim().matches(telRegex);
	}

	/**
	 * 验证用户名格式，用户名必须以英文字母或汉字开头
	 */
	public static boolean isUserNameNO(String userName) {

		// String userNameRegex = "^[\u4e00-\u9fa5 0-9 A-Z a-z]{6,16}$";
		// String userNameRegex =
		// "^[\u4e00-\u9fa5 A-Z a-z]{1}([\u4e00-\u9fa5 0-9 A-Z a-z]){5,15}$";
		String userNameRegex = "^[A-Z a-z]{1}([0-9 A-Z a-z]){1,}$";
		if (TextUtils.isEmpty(userName))
			return false;
		else
			return userName.trim().matches(userNameRegex);
	}

	/**
	 * 验证姓名格式，姓名必须以英文字母或汉字组成
	 */
	public static boolean isNameNO(String name) {

		String nameRegex = "^[\u4e00-\u9fa5a-zA-Z]+$";
		if (TextUtils.isEmpty(name))
			return false;
		else
			return name.trim().matches(nameRegex);
	}

	/**
	 * 验证密码格式，6-16位的半角字符，由字母、数字和下划线组成
	 */
	public static boolean isPwdNO(String password) {

		String nameRegex = "^[_0-9a-z]{6,16}$";
		if (TextUtils.isEmpty(password))
			return false;
		else
			return password.trim().matches(nameRegex);
	}

	public static boolean isCellular(Context context) {// 判断是否为移动网络
		ConnectivityManager connectivityManager = (ConnectivityManager) context
				.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
		if (activeNetInfo != null
				&& activeNetInfo.getType() == ConnectivityManager.TYPE_MOBILE
				&& activeNetInfo.isAvailable()) {
			return true;
		} else {
			return false;
		}
	}

	public static String mapToString(Map<String, String> map) {
		StringBuffer s = new StringBuffer();
		for (String key : map.keySet()) {
			s.append(key + ":" + map.get(key) + ",");
		}
		return s.toString();
	}

	public static String[] changeTaskPart(String functioncode,
			String peopleType, Task task, User user) {
		String[] str = new String[5];
		String taskstate = task.getStatusType_typeCode();
		String firsttime = task.getReportTime();
		String secondtime = task.getExpectTime();
		String firsttimestr = Config.NOTE_TIME_REPORT;
		String secondtimestr = Config.NOTE_TIME_EXPECT;
		boolean isReporter = isReporter(task, user.getUserId(),peopleType);
		// 业主
		if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTOFOWNER)// 户主维修进度（户内）
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTOFNONOWNER)// 非户主维修进度
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETOUTDOORPROGRESSLISTOFOWNER)
				) {// 户主维修进度（公区）
			if (task.getStatusType_typeCode().equals(Config.TYPECODE_DISPATCH)) {// dispatch
																					// 派单
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SUPERVISE)) {// supervise 维修进度-督办
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERDISPATCH)) {// managerDispatch 部门主管派单
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERSUPERVISE)) {// managerSupervise
														// 部门主管-督办
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERREDISPATCH)) {// managerRedispatch
															// 部门主管改派-改派
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REDISPATCH) // redispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROMD) // managerApplyRedispatchOnManagerDispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERPROG) // managerApplyRedispatchOnGet
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROS) // managerApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_SERVERAROS) // serverApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_SERVERAROG)) {// serverApplyRedispatchOnGet
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_RECEIVEORDER)) {// receiveOrder
													// 维修进度-待接单(显示：受理)
				taskstate = Config.TASKSTATE_GETTASK;// 待接单(显示：受理)
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVE)) {// serve 维修进度-维修
				taskstate = Config.TASKSTATE_DISTRIBUTE;// 分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REMINDE)) {// remind 维修进度-催单
				taskstate = Config.TASKSTATE_DISTRIBUTE;// 分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_FINISH)) {// finish
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_EXPECT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			}else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_EVALUATE)) {// evaluate
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REVISIT)) {// revisit
				taskstate = Config.TASKSTATE_REVISIT;// 待回访
				firsttime = task.getFinishTime();
				secondtime = task.getEvaluateTime();
				firsttimestr = Config.NOTE_TIME_FINISH;
				secondtimestr = Config.NOTE_TIME_EVALUATE;
			}
		}// 派单员
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTDISPACHER)// 派单员维修进度
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETDISPATCHTASKLIST)// 派单员报修分配
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETREDISPATCHTASKLIST)// 派单员改派
				|| functioncode.equals(Config.FUNCTION_REAL_OUTTIMEREPAIR)// 派单员超时改派
				|| functioncode.equals(Config.FUNCTION_REAL_GETREVISITTASKLIST)// 派单员回访
				||functioncode.equals(Config.FUNCTION_REAL_MYAPPLY) && peopleType.equals(Config.DISPATCHER)//我的提单（派单员）
		) {
			if (task.getStatusType_typeCode().equals(Config.TYPECODE_DISPATCH)) {// dispatch
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SUPERVISE)) {// supervise
				taskstate = Config.TASKSTATE_DUBAN;// 督办
				firsttime = task.getSuperviseTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_SUPERVISE;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERDISPATCH)) {// managerDispatch 部门主管派单
				//taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				taskstate = "待"+task.getDepartDispatcher_realName()+"分配";// 待部门派单员分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERSUPERVISE)) {// managerSupervise
														// 部门主管-督办
				taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERREDISPATCH)) {// managerRedispatch
															// 部门主管改派
				taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_RECEIVEORDER)) {// receiveOrder
				//taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				taskstate = "待"+task.getServer_realName()+"接单";// 待服务人员接单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVE)) {// serve
				//taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				taskstate = "待"+task.getServer_realName()+"维修";// 待服务人员处理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REMINDE)) {// remind
				taskstate = task.getServer_realName()+ Config.TASKSTATE_BEASKED;// 被催单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REDISPATCH)// redispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROMD)// managerApplyRedispatchOnManagerDispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERPROG)// managerApplyRedispatchOnGet
					|| task.getStatusType_typeCode().equals(// managerApplyRedispatchOnServe
							Config.TYPECODE_MANAGERAROS)) {// 部门主管申请改派
				taskstate = task.getDepartDispatcher_realName()
						+ Config.TASKSTATE_APPLYCHANGE;// 申请改派
				firsttime = task.getDepartDispatcherApplyRedispatchTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_APPLYCHANGE;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVERAROS)// serverApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(// serverApplyRedispatchOnGet
							Config.TYPECODE_SERVERAROG)) {// 服务人员申请改派
				taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_EVALUATE)) {// evaluate
				if (task.getAreaType_typeCode() != null) {
					if (task.getAreaType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				} else if (task.getHouse_houseType_typeCode() != null) {
					if (task.getHouse_houseType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				}

			}else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_FINISH)) {// finish
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_EXPECT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			}else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REVISIT)) {// revisit
				taskstate = Config.TASKSTATE_REVISIT;// 待回访
				firsttime = task.getFinishTime();
				secondtime = task.getEvaluateTime();
				firsttimestr = Config.NOTE_TIME_FINISH;
				secondtimestr = Config.NOTE_TIME_EVALUATE;
			}
		}
		// 项目经理
		else if (functioncode.equals(Config.FUNCTION_REAL_GETPMPROGRESSLIST)// 项目经理维修进度
				|| functioncode.equals(Config.FUNCTION_REAL_GETPMREVISITLIST)// 终止回访
				||functioncode.equals(Config.FUNCTION_REAL_MYAPPLY) && peopleType.equals(Config.DEPART_MANAGER)//我的提单（项目经理）
		) {
			if (task.getStatusType_typeCode().equals(Config.TYPECODE_DISPATCH)) {// dispatch
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SUPERVISE)) {// supervise
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERDISPATCH)) {// managerDispatch 部门主管派单
				taskstate = "待"+task.getDepartDispatcher_realName()+"分配";// 已分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERSUPERVISE)) {// managerSupervise
														// 部门主管-督办
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_RECEIVEORDER)) {// receiveOrder
				//taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				taskstate = "待"+task.getServer_realName()+"接单";// 待服务人员接单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVE)) {// serve
				//taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				taskstate = "待"+task.getServer_realName()+"维修";// 待服务人员处理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REMINDE)) {// remind
				taskstate = task.getServer_realName()+ Config.TASKSTATE_BEASKED;// 被催单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REDISPATCH)// redispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROMD)// managerApplyRedispatchOnManagerDispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERPROG)// managerApplyRedispatchOnGet
					|| task.getStatusType_typeCode().equals(// managerApplyRedispatchOnServe
							Config.TYPECODE_MANAGERAROS)) {// 部门主管申请改派
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVERAROS)// serverApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(// serverApplyRedispatchOnGet
							Config.TYPECODE_SERVERAROG)) {// 服务人员申请改派
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_EVALUATE)) {// evaluate
				if (task.getAreaType_typeCode() != null) {
					if (task.getAreaType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				} else if (task.getHouse_houseType_typeCode() != null) {
					if (task.getHouse_houseType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				}

			}else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_FINISH)) {// finish
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_EXPECT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REVISIT)) {// revisit
				taskstate = Config.TASKSTATE_REVISIT;// 待回访
				firsttime = task.getFinishTime();
				secondtime = task.getEvaluateTime();
				firsttimestr = Config.NOTE_TIME_FINISH;
				secondtimestr = Config.NOTE_TIME_EVALUATE;
			}
		}
		// 部门派单员
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTMANAGER)
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETMANAGERDISPATCHTASKLIST)
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETMANAGERREDISPATCHTASKLIST)
				|| functioncode
						.equals(Config.FUNCTION_REAL_OUTTIMEREPAIROFDEPART)
				||functioncode.equals(Config.FUNCTION_REAL_MYAPPLY) && peopleType.equals(Config.DEPART_DISPATCHER)&& isReporter//我的提单（部门派单员）
						) {
			if (task.getStatusType_typeCode().equals(Config.TYPECODE_DISPATCH)) {// dispatch
																					// 维修进度-待分配
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SUPERVISE)) {// supervise
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getSuperviseTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_SUPERVISE;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REDISPATCH) // redispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROMD)// managerApplyRedispatchOnManagerDispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERPROG)// managerApplyRedispatchOnGet
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROS)// managerApplyRedispatchOnServe
			) {// 部门主管申请改派
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getDepartDispatcherApplyRedispatchTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_APPLYCHANGE;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERDISPATCH)) {// managerDispatch
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 部门主管待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERSUPERVISE)) {// managerSupervise
				taskstate = Config.TASKSTATE_DUBAN;// 督办
				firsttime = task.getSuperviseTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_SUPERVISE;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_RECEIVEORDER)) {// receiveOrder
				//taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				taskstate = "待"+task.getServer_realName()+"接单";// 待服务人员接单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVE)) {// serve
				//taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				taskstate = "待"+task.getServer_realName()+"维修";// 待服务人员处理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REMINDE)) {// remind
				taskstate = task.getServer_realName()+ Config.TASKSTATE_BEASKED;// 被催单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVERAROS)// serverApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_SERVERAROG)) {// serverApplyRedispatchOnGet
				taskstate = task.getServer_realName()
						+ Config.TASKSTATE_APPLYCHANGE;// 申请改派
				firsttime = task.getSeverApplyRedispatchTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_APPLYCHANGE;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_EVALUATE)) {// evaluate
				if (task.getAreaType_typeCode() != null) {
					if (task.getAreaType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				} else if (task.getHouse_houseType_typeCode() != null) {
					if (task.getHouse_houseType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				}

			}else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_FINISH)) {// finish
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_EXPECT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REVISIT)) {// revisit
				taskstate = Config.TASKSTATE_REVISIT;// 待回访
				firsttime = task.getFinishTime();
				secondtime = task.getEvaluateTime();
				firsttimestr = Config.NOTE_TIME_FINISH;
				secondtimestr = Config.NOTE_TIME_EVALUATE;
			}
		}// 部门经理
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTSERVERMANAGER)
				||functioncode.equals(Config.FUNCTION_REAL_MYAPPLY) && peopleType.equals(Config.SERVER_MANAGER)//我的提单（部门经理）
				) {
			if (task.getStatusType_typeCode().equals(Config.TYPECODE_DISPATCH)) {// dispatch 待分配
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SUPERVISE)) {// supervise
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getSuperviseTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_SUPERVISE;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REDISPATCH) // redispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROMD)// managerApplyRedispatchOnManagerDispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERPROG)// managerApplyRedispatchOnGet
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROS)// managerApplyRedispatchOnServe
			) {// 部门主管申请改派
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERDISPATCH)) {// managerDispatch
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERSUPERVISE)) {// managerSupervise
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getSuperviseTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_SUPERVISE;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_RECEIVEORDER)) {// receiveOrder
				//taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				taskstate = "待"+task.getServer_realName()+"接单";// 待服务人员接单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVE)) {// serve
				//taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
				taskstate = "待"+task.getServer_realName()+"维修";// 待服务人员处理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REMINDE)) {// remind
				taskstate = task.getServer_realName()+ Config.TASKSTATE_BEASKED;// 被催单
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVERAROS)// serverApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_SERVERAROG)) {// serverApplyRedispatchOnGet
				taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_EVALUATE)) {// evaluate
				if (task.getAreaType_typeCode() != null) {
					if (task.getAreaType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				} else if (task.getHouse_houseType_typeCode() != null) {
					if (task.getHouse_houseType_typeCode().equals(
							Config.AREACODE_OUTDOOR)) {
						if (task.getReporter_userName().equals(user.getUsername())) {
							taskstate = Config.TASKSTATE_EVALUATE;// 待评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						} else {
							taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else {
						taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
						firsttime = task.getReportTime();
						secondtime = task.getFinishTime();
						firsttimestr = Config.NOTE_TIME_REPORT;
						secondtimestr = Config.NOTE_TIME_FINISH;
					}
				}

			}else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_FINISH)) {// finish
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_EXPECT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REVISIT)) {// revisit
				taskstate = Config.TASKSTATE_REVISIT;// 待回访
				firsttime = task.getFinishTime();
				secondtime = task.getEvaluateTime();
				firsttimestr = Config.NOTE_TIME_FINISH;
				secondtimestr = Config.NOTE_TIME_EVALUATE;
			}
		}
		// 维修人员
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTSEVER)// 服务人员维修进度
				|| functioncode.equals(Config.FUNCTION_REAL_GETREPAIRTASKLIST)// 服务人员维修任务
				||functioncode.equals(Config.FUNCTION_REAL_MYAPPLY) && peopleType.equals(Config.SERVER) && isReporter//我的提单（维修人员）
		) {
			if (user.isTaskExistByRepairId(task.getRepairId())) {//本地有保存
				Task localtask = user.getTasksByRepairId(task.getRepairId()).get(0);
				if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_REMINDE)) {// remind
					// 维修进度-催单
					taskstate = Config.TASKSTATE_BEASKED;// 被催单            
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				}else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_SERVE)) {// serve
				// 这里的“sever”对应的状态有待维修，维修中，待上报！
					if(localtask.isStopflag()){//停止维修
						taskstate = Config.TASKSTATE_TODO;// 待处理
					}else{
						if (localtask.getMoreflag()) {
							taskstate = Config.TASKSTATE_TOPOST;// 待上报
						} else {
							taskstate = Config.TASKSTATE_DOING;// 维修中
						}
					}
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				}
			} else {
				if (task.getStatusType_typeCode().equals(Config.TYPECODE_DISPATCH)) {// dispatch
					// 派单
					taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;

				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_SUPERVISE)) {// supervise 维修进度-督办
					
					taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_MANAGERDISPATCH)) {// managerDispatch 部门主管派单
					taskstate = "待"+task.getDepartDispatcher_realName()+"分配";// 已分配
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_MANAGERSUPERVISE)) {// managerSupervise
					// 部门主管-督办
					if (peopleType.equals(Config.DEPART_DISPATCHER)) {
						if (task.getReporter_userName().equals(
								task.getDepartDispatcher_realName())) {
							taskstate = Config.TASKSTATE_DUBAN;// 督辦
						} else {
							taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
						}

					} else if (peopleType.equals(Config.DISPATCHER)) {
						taskstate = Config.TASKSTATE_DISTRIBUTED;// 已分配
					} else {
						taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
					}
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;

				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_REDISPATCH) // redispatch
						|| task.getStatusType_typeCode().equals(
								Config.TYPECODE_MANAGERAROMD) // managerApplyRedispatchOnManagerDispatch
						|| task.getStatusType_typeCode().equals(
								Config.TYPECODE_MANAGERPROG) // managerApplyRedispatchOnGet
						|| task.getStatusType_typeCode().equals(
								Config.TYPECODE_MANAGERAROS) // managerApplyRedispatchOnServe
				) {
					taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_SERVERAROS) // serverApplyRedispatchOnServe
						|| task.getStatusType_typeCode().equals(
								Config.TYPECODE_SERVERAROG)) {// serverApplyRedispatchOnGet
					
					taskstate = Config.TASKSTATE_NOTDISTRIBUTE;// 待分配
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				}else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_REMINDE)) {// remind
					// 维修进度-催单
					taskstate = Config.TASKSTATE_BEASKED;// 被催单
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_RECEIVEORDER)) {// receiveOrder
					taskstate = Config.TASKSTATE_TORECEIVEORDER;
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				}else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_SERVE)) {// serve
				// 这里的“sever”对应的状态有待维修，维修中，待上报！
					if (task.isMoreflag()) {
						taskstate = Config.TASKSTATE_TOPOST;// 待上报
					} else {
						taskstate = Config.TASKSTATE_TODO;// 待处理
					}
					firsttime = task.getReportTime();
					secondtime = task.getExpectTime();
					firsttimestr = Config.NOTE_TIME_REPORT;
					secondtimestr = Config.NOTE_TIME_EXPECT;
				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_EVALUATE)) {// evaluate 维修进度-评价
					if (task.getAreaType_typeCode() != null) {
						if (task.getAreaType_typeCode().equals(
								Config.AREACODE_OUTDOOR)) {
							if (task.getReporter_userName().equals(user.getUsername())) {
								taskstate = Config.TASKSTATE_EVALUATE;// 待评价
								firsttime = task.getReportTime();
								secondtime = task.getFinishTime();
								firsttimestr = Config.NOTE_TIME_REPORT;
								secondtimestr = Config.NOTE_TIME_FINISH;
							} else {
								taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
								firsttime = task.getReportTime();
								secondtime = task.getFinishTime();
								firsttimestr = Config.NOTE_TIME_REPORT;
								secondtimestr = Config.NOTE_TIME_FINISH;
							}
						} else {
							taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					} else if (task.getHouse_houseType_typeCode() != null) {
						if (task.getHouse_houseType_typeCode().equals(
								Config.AREACODE_OUTDOOR)) {
							if (task.getReporter_userName().equals(user.getUsername())) {
								taskstate = Config.TASKSTATE_EVALUATE;// 待评价
								firsttime = task.getReportTime();
								secondtime = task.getFinishTime();
								firsttimestr = Config.NOTE_TIME_REPORT;
								secondtimestr = Config.NOTE_TIME_FINISH;
							} else {
								taskstate = Config.TASKSTATE_REPORTER_EVALUATE;// 待提单人评价
								firsttime = task.getReportTime();
								secondtime = task.getFinishTime();
								firsttimestr = Config.NOTE_TIME_REPORT;
								secondtimestr = Config.NOTE_TIME_FINISH;
							}
						} else {
							taskstate = Config.TASKSTATE_HOST_EVALUATE;// 待业主评价
							firsttime = task.getReportTime();
							secondtime = task.getFinishTime();
							firsttimestr = Config.NOTE_TIME_REPORT;
							secondtimestr = Config.NOTE_TIME_FINISH;
						}
					}
				} else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_FINISH)) {// finish
					taskstate = Config.TASKSTATE_DONE;// 完成
					firsttime = task.getReportTime();
					secondtime = task.getFinishTime();
					firsttimestr = Config.NOTE_TIME_EXPECT;
					secondtimestr = Config.NOTE_TIME_FINISH;
				}else if (task.getStatusType_typeCode().equals(
						Config.TYPECODE_REVISIT)) {// revisit 维修进度-待回访
					taskstate = Config.TASKSTATE_REVISIT;// 待回访
					firsttime = task.getFinishTime();
					secondtime = task.getEvaluateTime();
					firsttimestr = Config.NOTE_TIME_FINISH;
					secondtimestr = Config.NOTE_TIME_EVALUATE;
				} 
			}
		}else if (functioncode.equals(Config.FUNCTION_REAL_MYAPPLY) && !isReporter//我的提单（非提单人）		
				) {// 户主维修进度（公区）
			if (task.getStatusType_typeCode().equals(Config.TYPECODE_DISPATCH)) {// dispatch
																					// 派单
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SUPERVISE)) {// supervise 维修进度-督办
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERDISPATCH)) {// managerDispatch 部门主管派单
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERSUPERVISE)) {// managerSupervise
														// 部门主管-督办
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;

			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_MANAGERREDISPATCH)) {// managerRedispatch
															// 部门主管改派-改派
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REDISPATCH) // redispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROMD) // managerApplyRedispatchOnManagerDispatch
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERPROG) // managerApplyRedispatchOnGet
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_MANAGERAROS) // managerApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_SERVERAROS) // serverApplyRedispatchOnServe
					|| task.getStatusType_typeCode().equals(
							Config.TYPECODE_SERVERAROG)) {// serverApplyRedispatchOnGet
				taskstate = Config.TASKSTATE_GETTASK;// 受理
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_RECEIVEORDER)) {// receiveOrder
													// 维修进度-待接单(显示：受理)
				taskstate = Config.TASKSTATE_GETTASK;// 待接单(显示：受理)
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_SERVE)) {// serve 维修进度-维修
				taskstate = Config.TASKSTATE_DISTRIBUTE;// 分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REMINDE)) {// remind 维修进度-催单
				taskstate = Config.TASKSTATE_DISTRIBUTE;// 分配
				firsttime = task.getReportTime();
				secondtime = task.getExpectTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_EXPECT;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_FINISH)) {// finish
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_EXPECT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			}else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_EVALUATE)) {// evaluate
				taskstate = Config.TASKSTATE_DONE;// 完成
				firsttime = task.getReportTime();
				secondtime = task.getFinishTime();
				firsttimestr = Config.NOTE_TIME_REPORT;
				secondtimestr = Config.NOTE_TIME_FINISH;
			} else if (task.getStatusType_typeCode().equals(
					Config.TYPECODE_REVISIT)) {// revisit
				taskstate = Config.TASKSTATE_REVISIT;// 待回访
				firsttime = task.getFinishTime();
				secondtime = task.getEvaluateTime();
				firsttimestr = Config.NOTE_TIME_FINISH;
				secondtimestr = Config.NOTE_TIME_EVALUATE;
			}
		}
		str[0] = taskstate;
		if (null != firsttime) {
			if (firsttime.length() > 19) {
				str[1] = firsttime.substring(2, 19);
			} else {
				str[1] = firsttime;
			}
		} else {
			str[1] = task.getReportTime().substring(2, 19);
		}

		if (null != secondtime) {
			if (secondtime.length() > 19) {
				str[2] = secondtime.substring(2, 19);
			} else {
				str[2] = secondtime;
			}
		}
		Log.e("Tool>>functioncode", functioncode);
		Log.e("Tool>>>typecode", task.getStatusType_typeCode());
		Log.e("Tool>>>typestate", taskstate);
		Log.e("Tool>>>firsttimestr", firsttimestr);
		Log.e("Tool>>>secondtimestr", secondtimestr);
		str[3] = firsttimestr;
		str[4] = secondtimestr;
		return str;

	}

	/**
	 * 获取手机Mac
	 * 
	 * @param context
	 * @return
	 */
	public static String getLocalMacAddress(Context context) {
		WifiManager wifi = (WifiManager) context
				.getSystemService(Context.WIFI_SERVICE);
		WifiInfo info = wifi.getConnectionInfo();
		return info.getMacAddress();
	}

	/**
	 * 获取手机IMEI
	 * 
	 * @param context
	 * @return
	 */
	public static String getLocalIMEI(Context context) {
		TelephonyManager tm = (TelephonyManager) context
				.getSystemService(Context.TELEPHONY_SERVICE);
		return tm.getDeviceId();
	}

	public static Task setTaskAll(String functioncode, String peopleType,
			Task task, User user) {
		String[] chanstr = Tool.changeTaskPart(functioncode, peopleType, task,
				user);
		task.setTaskState(chanstr[0]);
		task.setFirstTime(chanstr[1]);
		task.setSecondTime(chanstr[2]);
		task.setFirstTimeStr(chanstr[3]);
		task.setSecondTimeStr(chanstr[4]);
		task.setHouseAllName(changeHouseNam(task));
		task.setReportTime(changeTimeStr(task).get("reportTime"));
		task.setExpectTime(changeTimeStr(task).get("expectTime"));
		task.setAcceptTime(changeTimeStr(task).get("acceptTime"));
		task.setDispatchTime(changeTimeStr(task).get("dispatchTime"));
		task.setReDispatchTime(changeTimeStr(task).get("reDispatchTime"));
		task.setFinishTime(changeTimeStr(task).get("finishTime"));
		task.setVisitTime(changeTimeStr(task).get("visitTime"));
		task.setEvaluateTime(changeTimeStr(task).get("evaluateTime"));
		task.setSuperviseTime(changeTimeStr(task).get("superviseTime"));
		task.setSeverApplyRedispatchTime(changeTimeStr(task).get(
				"severApplyRedispatchTime"));
		task.setDepartDispatcherApplyRedispatchTime(changeTimeStr(task).get(
				"departDispatcherApplyRedispatchTime"));
		task.setVisitTerminateTime(changeTimeStr(task)
				.get("visitTerminateTime"));
		task.setFunctionCode(functioncode);
		task.setIschange(1);
		// task.setVisitTerminator_realName(visitTerminator_realName)
		task.setAreaname(changeAreaName(task));
		return task;

	}

	/**
	 * 转换task的显示信息
	 * 
	 * @param initprofuncs
	 * @param functioncode
	 * @param peopleType
	 * @param task
	 * @param user
	 * @return
	 */
	public static Task setTaskAll(List<InitProgressFunction> initprofuncs,
			String functioncode, String peopleType, Task task, User user) {
		String[] chanstr = Tool.changeTaskPart(initprofuncs, functioncode,
				peopleType, task, user);
		task.setTaskState(chanstr[0]);
		task.setFirstTime(chanstr[1]);
		task.setSecondTime(chanstr[2]);
		task.setHouseAllName(changeHouseNam(task));
		task.setReportTime(changeTimeStr(task).get("reportTime"));
		task.setExpectTime(changeTimeStr(task).get("expectTime"));
		task.setAcceptTime(changeTimeStr(task).get("acceptTime"));
		task.setDispatchTime(changeTimeStr(task).get("dispatchTime"));
		task.setReDispatchTime(changeTimeStr(task).get("reDispatchTime"));
		task.setFinishTime(changeTimeStr(task).get("finishTime"));
		task.setVisitTime(changeTimeStr(task).get("visitTime"));
		task.setEvaluateTime(changeTimeStr(task).get("evaluateTime"));
		task.setSuperviseTime(changeTimeStr(task).get("superviseTime"));
		task.setSeverApplyRedispatchTime(changeTimeStr(task).get(
				"severApplyRedispatchTime"));
		task.setDepartDispatcherApplyRedispatchTime(changeTimeStr(task).get(
				"departDispatcherApplyRedispatchTime"));
		task.setFunctionCode(functioncode);
		task.setIschange(1);
		task.setAreaname(changeAreaName(task));
		return task;

	}

	// 区域名称
	public static String changeAreaName(Task task) {
		String areaname = "";
		if (task.getAreaType_typeCode() != null) {
			if (task.getAreaType_typeCode().equals(Config.AREACODE_INDOOR)) {
				areaname = Config.AREANAME_INDOOR;
			} else if (task.getAreaType_typeCode().equals(
					Config.AREACODE_BUSINESS)) {
				areaname = Config.AREANAME_BUSINESS;
			} else {
				areaname = Config.AREANAME_PUBLIC;
			}
		} else if (task.getHouse_houseType_typeCode() != null) {
			if (task.getHouse_houseType_typeCode().equals(
					Config.AREACODE_INDOOR)) {
				areaname = Config.AREANAME_INDOOR;
			} else if (task.getHouse_houseType_typeCode().equals(
					Config.AREACODE_BUSINESS)) {
				areaname = Config.AREANAME_BUSINESS;
			} else {
				areaname = Config.AREANAME_PUBLIC;
			}
		}

		return areaname;
	}

	// 房屋信息拼接
	public static String changeHouseNam(Task task) {
		String houseallname = "";

		if (task.getAreaType_typeCode() != null) {
			if (task.getAreaType_typeCode().equals(Config.AREACODE_INDOOR)) {
				houseallname = task.getProjectName() + task.getHouseName();
			} else if (task.getAreaType_typeCode().equals(
					Config.AREACODE_BUSINESS)) {
				houseallname = task.getProjectName() + task.getHouseName();
			} else {
				houseallname = task.getProjectName() + task.getAreaDetail();
			}
		} else if (task.getHouse_houseType_typeCode() != null) {
			if (task.getHouse_houseType_typeCode().equals(
					Config.AREACODE_INDOOR)) {
				houseallname = task.getProjectName() + task.getHouseName();
			} else if (task.getHouse_houseType_typeCode().equals(
					Config.AREACODE_BUSINESS)) {
				houseallname = task.getProjectName() + task.getHouseName();
			} else {
				houseallname = task.getProjectName() + task.getAreaDetail();
			}
		}

		return houseallname;
	}

	// 时间转换，去除小数点
	public static Map<String, String> changeTimeStr(Task task) {
		Map<String, String> timemap = new HashMap<String, String>();
		int timelength = 19;
		timemap.put("reportTime", "");
		timemap.put("expectTime", "");
		timemap.put("acceptTime", "");
		timemap.put("dispatchTime", "");
		timemap.put("reDispatchTime", "");
		timemap.put("repairTime", "");
		timemap.put("finishTime", "");
		timemap.put("visitTime", "");
		timemap.put("evaluateTime", "");
		// 增加superviseTime
		timemap.put("superviseTime", "");
		timemap.put("severApplyRedispatchTime", "");
		timemap.put("departDispatcherApplyRedispatchTime", "");
		timemap.put("visitTerminateTime ", "");
		if (null != task.getReportTime()) {
			if (task.getReportTime().length() > timelength) {
				timemap.put("reportTime",
						task.getReportTime().substring(0, timelength));
			} else {
				timemap.put("reportTime", task.getReportTime());
			}
		}
		if (null != task.getExpectTime()) {
			if (task.getExpectTime().length() > timelength) {
				timemap.put("expectTime",
						task.getExpectTime().substring(0, timelength));
			} else {
				timemap.put("expectTime", task.getExpectTime());
			}
		}
		if (null != task.getDispatchTime()) {
			if (task.getDispatchTime().length() > timelength) {
				timemap.put("dispatchTime",
						task.getDispatchTime().substring(0, timelength));
			} else {
				timemap.put("dispatchTime", task.getDispatchTime());
			}
		}
		if (null != task.getReDispatchTime()) {
			if (task.getReDispatchTime().length() > timelength) {
				timemap.put("reDispatchTime", task.getReDispatchTime()
						.substring(0, timelength));
			} else {
				timemap.put("reDispatchTime", task.getReDispatchTime());
			}
		}
		if (null != task.getRepairTime()) {
			if (task.getRepairTime().length() > timelength) {
				timemap.put("repairTime",
						task.getRepairTime().substring(0, timelength));
			} else {
				timemap.put("repairTime", task.getRepairTime());
			}
		}
		if (null != task.getFinishTime()) {
			if (task.getFinishTime().length() > timelength) {
				timemap.put("finishTime",
						task.getFinishTime().substring(0, timelength));
			} else {
				timemap.put("finishTime", task.getFinishTime());
			}
		}
		if (null != task.getVisitTime()) {
			if (task.getVisitTime().length() > timelength) {
				timemap.put("visitTime",
						task.getVisitTime().substring(0, timelength));
			} else {
				timemap.put("visitTime", task.getVisitTime());
			}
		}
		if (null != task.getEvaluateTime()) {
			if (task.getEvaluateTime().length() > timelength) {
				timemap.put("evaluateTime",
						task.getEvaluateTime().substring(0, timelength));
			} else {
				timemap.put("evaluateTime", task.getEvaluateTime());
			}

		}
		if (null != task.getSuperviseTime()) {
			if (task.getSuperviseTime().length() > timelength) {
				timemap.put("superviseTime",
						task.getSuperviseTime().substring(0, timelength));
			} else {
				timemap.put("superviseTime", task.getSuperviseTime());
			}

		}
		if (null != task.getSuperviseTime()) {
			if (task.getSuperviseTime().length() > timelength) {
				timemap.put("severApplyRedispatchTime", task.getSuperviseTime()
						.substring(0, timelength));
			} else {
				timemap.put("severApplyRedispatchTime", task.getSuperviseTime());
			}

		}
		if (null != task.getSuperviseTime()) {
			if (task.getSuperviseTime().length() > timelength) {
				timemap.put("managerApplyRedispatchTime", task
						.getSuperviseTime().substring(0, timelength));
			} else {
				timemap.put("managerApplyRedispatchTime",
						task.getSuperviseTime());
			}

		}
		if (null != task.getVisitTerminateTime()) {
			if (task.getVisitTerminateTime().length() > timelength) {
				timemap.put("visitTerminateTime", task.getVisitTerminateTime()
						.substring(0, timelength));
			} else {
				timemap.put("visitTerminateTime", task.getVisitTerminateTime());
			}

		}
		return timemap;
	}

	// 获取个人信息
	public static void getEditPerson(Context context) {
		User user;
		try {
			String setsessionid = "";
			user = SingleSample.getInstance(context).getUser();
			if (null != user) {
				if (null != user.getSessionId()
						&& !user.getSessionId().equals("")) {
					setsessionid = user.getSessionId();
				}
			}
			String url = Tool.getConfigUrl(Config.SERVER_URL, Config.GET_PERSON_URL);
			String result = null;
			result = HttpUtil.postRequestNomapSe(url, setsessionid);
			Log.e("MainActivity获取个人信息的result", result);
			if (!result.equals(Config.HTTP_FAIL)) {
				result = result.replace("rows", "useraccounts");
				JSONObject jsonobj = new JSONObject(result);
				String message = jsonobj.getString("message");
				String flag = jsonobj.getString("flag");
				String rows = jsonobj.getString("useraccounts");
				rows = rows.replace("id", "userId");
				if (flag.equals(Config.CONNECT_SUCCESS2)) {
					java.lang.reflect.Type type = new TypeToken<List<UserAccount>>() {
					}.getType();
					Gson gson = new Gson();
					List<UserAccount> uas = gson.fromJson(rows, type);
					if (!user.getUseraccounts().isEmpty()) {
						DataSupport.deleteAll(UserAccount.class);
					}
					String userid = "";
					for (UserAccount ua : uas) {
						ua.setUser(user);
						ua.save();
						userid = ua.getUserId();
					}
					user.setUserId(userid);
					user.setUseraccounts(uas);
					user.update(user.getId());

				} else {
					List<UserAccount> us = new ArrayList<UserAccount>();
					UserAccount ua = new UserAccount();
					ua.setUser(user);
					ua.save();
					us.add(ua);
					user.setUseraccounts(us);
					user.update(user.getId());
				}
			} else {
				List<UserAccount> us = new ArrayList<UserAccount>();
				UserAccount ua = new UserAccount();
				ua.setUser(user);
				ua.save();
				us.add(ua);
				user.setUseraccounts(us);
				user.update(user.getId());
			}

		} catch (Exception e) {

			Log.e("ServiceScheduleActivity", "个人信息数据获取报错");

			e.printStackTrace();
		}
	}

	/**
	 * 判断当前操作者是否为提单人
	 * 
	 * @param task
	 * @param userId
	 * @param peopleType
	 * @return
	 */
	public static boolean isReporter(Task task, String userId, String peopleType) {
		boolean isflag = false;
		if (peopleType.equals(Config.SERVER)) {
			if (null != task.getServer_id()
					&& userId.equals(task.getServer_id())) {
				isflag = true;
			}
		} else if (peopleType.equals(Config.DEPART_DISPATCHER)) {
			if (null != task.getDepartDispatcher_id()
					&& userId.equals(task.getDepartDispatcher_id())) {
				isflag = true;
			}
		}

		return isflag;
	}

	/**
	 * 判断用户类型
	 * 
	 * @param functionCodeList
	 * @return
	 */
	public static String getPeopleType(ArrayList<String> functionCodeList) {
		// TODO Auto-generated method stub
		// 业主
		String peopleType = "";
		if (functionCodeList
				.contains(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTOFOWNER)
				|| functionCodeList
						.contains(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTOFNONOWNER)) {
			peopleType = Config.HOSTER;

		}
		// 派单员
		else if (functionCodeList
				.contains(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTDISPACHER)) {
			peopleType = Config.DISPATCHER;

		}// 主管
		else if (functionCodeList
				.contains(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTMANAGER)) {
			peopleType = Config.DEPART_DISPATCHER;

		}// 维修人员
		else if (functionCodeList
				.contains(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTSEVER)) {
			peopleType = Config.SERVER;

		}// 项目经理
		else if (functionCodeList
				.contains(Config.FUNCTION_REAL_GETPMPROGRESSLIST)) {
			peopleType = Config.DEPART_MANAGER;

		}// 部门经理
		else if (functionCodeList
				.contains(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTSERVERMANAGER)) {
			peopleType = Config.SERVER_MANAGER;

		}
		return peopleType;
	}

	/**
	 * 判断房屋类型
	 * 
	 * @param functionCodeList
	 * @return
	 */
	public static String getHouseType(Task task) {
		String areaname = "";
		if (task.getHouse_houseType_typeCode() != null) {
			if (task.getHouse_houseType_typeCode().equals(
					Config.AREACODE_OUTDOOR)) {
				areaname = Config.AREANAME_PUBLIC;
			} else if (task.getHouse_houseType_typeCode().equals(
					Config.AREACODE_BUSINESS)) {
				areaname = Config.AREANAME_BUSINESS;
			} else {
				areaname = Config.AREANAME_INDOOR;
			}
		}
		return areaname;
	}

	/**
	 * 判断dialog的显示与消失
	 * 
	 * @param
	 * @return void
	 */
	public static void judgedialog(Context context, String message,
			CustomLoadingDialog uploadingdialog, ProgressBar loginbar) {
		if (uploadingdialog.isShowing()) {
			uploadingdialog.dismiss();
		} else {
			uploadingdialog.show();
		}
		loginbar.setVisibility(android.view.View.INVISIBLE);
		Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
	}

	public static void searchMatch(Context context, String editstring,
			String message, String functioncode,
			HashMap<String, String> orderList,
			HashMap<String, String> searchList) {

		String search = editstring;
		for (int i = 0; i < Config.TST_JUDGE.length; i++) {
			if (Config.TST_JUDGE[i].contains(search)) {
				searchList.put("statusType_typeCode",
						Config.TST_TRASFORMATION[i]);
			}
		}
		if (searchList.isEmpty()) {
			searchList.put("statusType_typeCode", search);
		}
		/*
		 * if (functioncode.equals(Config.FUNCTION_REPAIRPROGRESS)) {// 维修进度 if
		 * (search.contains("受") || search.contains("理")) {
		 * searchList.put("statusType_typeCode", Config.TYPECODE_DISPATCH + "-"
		 * + Config.TYPECODE_REDISPATCH + "-" + Config.TYPECODE_SUPERVISE);
		 * search = null; Log.d("statusType_typeCode", Config.TYPECODE_DISPATCH
		 * + "-" + Config.TYPECODE_REDISPATCH + "-" +
		 * Config.TYPECODE_SUPERVISE); } else if (search.contains("分") ||
		 * search.contains("配")) { searchList.put("statusType_typeCode",
		 * Config.TYPECODE_SERVE); search = null; Log.d("statusType_typeCode",
		 * Config.TYPECODE_SERVE); } else if (search.contains("完") ||
		 * search.contains("成")) { searchList.put("statusType_typeCode",
		 * Config.TYPECODE_EVALUATE); search = null;
		 * Log.d("statusType_typeCode", Config.TYPECODE_EVALUATE); } else if
		 * (search.contains("催") || search.contains("单")) {
		 * searchList.put("statusType_typeCode", Config.TYPECODE_REMINDE);
		 * search = null; Log.d("statusType_typeCode", Config.TYPECODE_REMINDE);
		 * } else if (search.contains("待") || search.contains("回") ||
		 * search.contains("访")) { searchList.put("statusType_typeCode",
		 * Config.TASKSTATE_REVISIT); search = null;
		 * Log.d("statusType_typeCode", Config.TASKSTATE_REVISIT); } else if
		 * (search.contains("待") || search.contains("接") ||
		 * search.contains("单")) { searchList.put("statusType_typeCode",
		 * Config.TASKSTATE_TORECEIVEORDER); search = null;
		 * Log.d("statusType_typeCode", Config.TASKSTATE_TORECEIVEORDER); } else
		 * { searchList.put("statusType_typeCode", search);
		 * Log.d("statusType_typeCode", search); } } else if (functioncode
		 * .equals(Config.FUNCTION_REPAIRDISTRIBUTE)) {// 报修分配 if
		 * (search.contains("待") || search.contains("分") ||
		 * search.contains("配")) { searchList.put("statusType_typeCode",
		 * Config.TYPECODE_DISPATCH); search = null;
		 * Log.d("statusType_typeCode", Config.TYPECODE_DISPATCH); } else if
		 * (search.contains("督") || search.contains("办")) {
		 * searchList.put("statusType_typeCode", Config.TYPECODE_SUPERVISE); //
		 * searchList.put("superviseTime", search); search = null;
		 * Log.d("statusType_typeCode", Config.TYPECODE_SUPERVISE); } else {
		 * searchList.put("statusType_typeCode", search);
		 * Log.d("statusType_typeCode", search); } } else if (functioncode
		 * .equals(Config.FUNCTION_RESSIGNMENT)) {// 改派 if (search.contains("已")
		 * || search.contains("分") || search.contains("配")) {
		 * searchList.put("statusType_typeCode", Config.TYPECODE_SERVE); search
		 * = null; Log.d("statusType_typeCode", Config.TYPECODE_SERVE); } else
		 * if (search.contains("申") || search.contains("请") ||
		 * search.contains("改") || search.contains("派")) {
		 * searchList.put("statusType_typeCode", Config.TYPECODE_SUPERVISE);
		 * search = null; Log.d("statusType_typeCode",
		 * Config.TYPECODE_SUPERVISE); } else if (search.contains("催") ||
		 * search.contains("单")) { searchList.put("statusType_typeCode",
		 * Config.TYPECODE_REMINDE); search = null; Log.d("statusType_typeCode",
		 * Config.TYPECODE_REMINDE); } else {
		 * searchList.put("statusType_typeCode", search);
		 * Log.d("statusType_typeCode", search); } } else if (functioncode
		 * .equals(Config.FUNCTION_RETURNVISIT)) {// 回访：实际搜索，1星，2星，revisit if
		 * (search.contains("待") || search.contains("回") ||
		 * search.contains("访")) { searchList.put("statusType_typeCode",
		 * Config.TYPECODE_REVISIT); search = null; Log.d("statusType_typeCode",
		 * Config.TYPECODE_REVISIT); } else {
		 * searchList.put("statusType_typeCode", search);
		 * Log.d("statusType_typeCode", search); } } else if (functioncode
		 * .equals(Config.FUNCTION_REPAIRTASK)) {// 维修任务 if
		 * (search.contains("被") || search.contains("催") ||
		 * search.contains("单")) { searchList.put("statusType_typeCode",
		 * Config.TYPECODE_REMINDE); search = null; Log.d("statusType_typeCode",
		 * Config.TYPECODE_REMINDE); } else if (search.contains("待") ||
		 * search.contains("处") || search.contains("理")) {
		 * searchList.put("statusType_typeCode", Config.TYPECODE_SERVE); search
		 * = null; Log.d("statusType_typeCode", Config.TYPECODE_SERVE); } else
		 * if (search.contains("待") || search.contains("接") ||
		 * search.contains("单")) { searchList.put("statusType_typeCode",
		 * Config.TYPECODE_RECEIVEORDER); search = null;
		 * Log.d("statusType_typeCode", Config.TYPECODE_RECEIVEORDER); } else {
		 * searchList.put("statusType_typeCode", search);
		 * Log.d("statusType_typeCode", search); } } ;
		 */
		orderList.put("statusType_typeCode", "ASC");
		// orderList.put("statusType_typeCode", "DESC");
		orderList.put("reporttime", "ASC");
		System.out.println("orderList----->" + orderList);
		// searchList.put("search", search);
		// searchList.put("house_Id",task.getHouse_id() );
		searchList.put("projectName", search);
		searchList.put("phaseName", search);
		searchList.put("buildingName", search);
		searchList.put("unitName", search);
		searchList.put("houseName", search);
		searchList.put("reportTime", search);
		searchList.put("expectTime", search);
		searchList.put("unitName", search);
		searchList.put("superviseTime", search);

		searchList.put("reportTime", "");
		searchList.put("expectTime", "");
		searchList.put("acceptTime", "");
		searchList.put("dispatchTime", "");
		searchList.put("reDispatchTime", "");
		searchList.put("repairTime", "");
		searchList.put("finishTime", "");
		searchList.put("visitTime", "");
		searchList.put("evaluateTime", "");
		searchList.put("severApplyRedispatchTime", "");
		searchList.put("departDispatcherApplyRedispatchTime", "");
		System.out.println("searchList----->" + searchList);
		/*
		 * searchList.put("firstTimeStr",search);
		 * searchList.put("secondTimeStr", search);
		 */
		// 下面这项有多重情况!
		// searchList.put("statusType_typeCode", search);
		// orderList.put("reporttime", "DESC");
		/*
		 * Page = String.valueOf(page); new getSearchTasks(Page, orderList,
		 * searchList).start();
		 */

	}

	public static int voiceTime(Context context, String filepath) {
		int time = 0;
		MediaPlayer player = MediaPlayer.create(context,
				Uri.fromFile(new File(filepath)));
		if (player != null) {
			time = player.getDuration();
		}

		/*
		 * MediaPlayer player=MediaPlayer.create(context, Uri.fromFile(new
		 * File(filepath))); int time = player.getDuration();
		 */
		return time;
	}

	/**
	 * 根据functionCode获取URL
	 * 
	 * @param user
	 * @param functionCode
	 * @return
	 */
	public static String getUrlFromUrl(User user, String functionCode) {
		String url;
		url = Config.SERVER_URL
				+ user.getFunctionlistFromUser(functionCode).get(0)
						.getFunctionUrl();
		return url;
	}

	/**
	 * 根据progressFunctionCode确定详情界面获取数据的FunctionCode
	 * 
	 * @param listFunctionCode
	 * @return
	 */
	public static String getDetailFunctionCode(String listFunctionCode) {
		String detailFunctionCode = "";
		for (int i = 0; i < Config.FUNC_PEOPLE_TYPE_ARR.length; i++) {
			if (StringUtil.isStringEqual(listFunctionCode,
					Config.FUNC_PEOPLE_TYPE_ARR[i])) {
				detailFunctionCode = Config.DETAIL_FUNC_ARR[i];
			}
		}
		return detailFunctionCode;
	}

	/**
	 * 根据StatusType_typeCode来查询InitTaskState
	 * 
	 * @param initprofunc
	 * @param StatusType_typeCode
	 * @return
	 */
	public static InitTaskState getInitTaskStateByCode(
			InitProgressFunction initprofunc, String StatusType_typeCode) {
		InitTaskState initts = new InitTaskState();
		// 找到对应InitTaskState
		for (InitTaskState ts : initprofunc.getStatus()) {
			if (StringUtil.isStringEqual(StatusType_typeCode,
					ts.getStatusType_typeCode())) {
				initts = ts;
			}
		}
		return initts;
	}

	/**
	 * 获取当前界面的操作功能
	 * 
	 * @param initTS
	 * @param page
	 * @return
	 */
	public static List<InitOperation> getInitOperationOfPage(
			InitTaskState initTS, int page) {
		List<InitOperation> initOPs = new ArrayList<InitOperation>();
		/*
		 * for(InitOperation op:initTS.getOperation()){ String currentsegue =
		 * op.getSegue(); if(StringUtil.isStringEqual(currentsegue, page+"")) {
		 * initOPs.add(op); } }
		 */
		for (InitOperation op : initTS.getOperation()) {
			String currentsegue = initTS.getSegue();
			if (StringUtil.isStringEqual(currentsegue, page + "")) {
				initOPs.add(op);
			}
		}
		return initOPs;
	}

	/**
	 * 根据标志functionCode判断功能用户类型
	 * 
	 * @param functioncode
	 * @param peopleType
	 * @param isReporter
	 * @return
	 */
	public static String getFunctionPeopleType(String functioncode,
			String peopleType, boolean isReporter) {
		String functionpeopleType;
		// 业主
		if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTOFOWNER)// 户主维修进度（户内）
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTOFNONOWNER)// 非户主维修进度
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETOUTDOORPROGRESSLISTOFOWNER)
				|| functioncode.equals(Config.FUNCTION_REAL_MYAPPLY)
				&& !isReporter// 我的提单（非提单人）
		) {
			functionpeopleType = Config.HOSTER;// 户主、非户主暂不区分
		}// 派单员
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTDISPACHER)// 派单员维修进度
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETDISPATCHTASKLIST)// 派单员报修分配
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETREDISPATCHTASKLIST)// 派单员改派
				|| functioncode.equals(Config.FUNCTION_REAL_OUTTIMEREPAIR)// 派单员超时改派
				|| functioncode.equals(Config.FUNCTION_REAL_GETREVISITTASKLIST)// 派单员回访
				|| functioncode.equals(Config.FUNCTION_REAL_MYAPPLY)
				&& peopleType.equals(Config.DISPATCHER)// 我的提单（派单员）
		) {
			functionpeopleType = Config.DISPATCHER;
		}
		// 项目经理
		else if (functioncode.equals(Config.FUNCTION_REAL_GETPMPROGRESSLIST)// 项目经理维修进度
				|| functioncode.equals(Config.FUNCTION_REAL_GETPMREVISITLIST)// 终止回访
				|| functioncode.equals(Config.FUNCTION_REAL_MYAPPLY)
				&& peopleType.equals(Config.DEPART_MANAGER)// 我的提单（项目经理）
		) {
			functionpeopleType = Config.DEPART_MANAGER;
		}
		// 部门派单员
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTMANAGER)
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETMANAGERDISPATCHTASKLIST)
				|| functioncode
						.equals(Config.FUNCTION_REAL_GETMANAGERREDISPATCHTASKLIST)
				|| functioncode
						.equals(Config.FUNCTION_REAL_OUTTIMEREPAIROFDEPART)
				|| functioncode.equals(Config.FUNCTION_REAL_MYAPPLY)
				&& peopleType.equals(Config.DEPART_DISPATCHER) && isReporter// 我的提单（部门派单员）
		) {
			functionpeopleType = Config.DEPART_DISPATCHER;
		}// 部门经理
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTSERVERMANAGER)
				|| functioncode.equals(Config.FUNCTION_REAL_MYAPPLY)
				&& peopleType.equals(Config.SERVER_MANAGER)// 我的提单（部门经理）
		) {
			functionpeopleType = Config.SERVER_MANAGER;
		}
		// 维修人员
		else if (functioncode
				.equals(Config.FUNCTION_REAL_GETREPAIRPROGRESSLISTSEVER)// 服务人员维修进度
				|| functioncode.equals(Config.FUNCTION_REAL_GETREPAIRTASKLIST)// 服务人员维修任务
				|| functioncode.equals(Config.FUNCTION_REAL_MYAPPLY)
				&& peopleType.equals(Config.SERVER) && isReporter// 我的提单（维修人员）
		) {
			functionpeopleType = Config.SERVER;
		}
		return peopleType;

	}

	/**
	 * 转换task的显示信息
	 * 
	 * @param initprofuncs
	 * @param functioncode
	 * @param peopleType
	 * @param task
	 * @param user
	 * @return
	 */
	public static String[] changeTaskPart(
			List<InitProgressFunction> initprofuncs, String functioncode,
			String peopleType, Task task, User user) {
		String[] str = new String[5];
		String taskstate = task.getStatusType_typeCode();
		String firsttime = "";
		String secondtime = "";
		boolean isReporter = isReporter(task, user.getUserId(), peopleType);
		String functionPeopleType = getFunctionPeopleType(functioncode,
				peopleType, isReporter);

		InitTaskState ts = getInitTaskState(user, task, initprofuncs,
				functioncode, functionPeopleType);
		if (StringUtil.isStringAvailable(ts.getTaskState())) {
			taskstate = ts.getTaskState();
		}
		taskstate = StringUtil.replaceString(taskstate,
				"%departDispatcher_realName%",
				task.getDepartDispatcher_realName());
		taskstate = StringUtil.replaceString(taskstate,
				"%dispatcher_realName%", task.getDispatcher_realName());
		taskstate = StringUtil.replaceString(taskstate, "%server_realName%",
				task.getServer_realName());
		taskstate = StringUtil.replaceString(taskstate, "%reporter_realName%",
				task.getReporter_realName());
		taskstate = StringUtil.replaceString(taskstate, "%server_realName%",
				task.getServer_realName());
		taskstate = StringUtil.replaceString(taskstate, "%averageStar%",
				"综合评价：" + task.getAverageStar() + "星");
		firsttime = "reportTime";
		secondtime = "expectTime";
		if (null != ts.getShowKeys() && ts.getShowKeys().size() == 2) {
			if (StringUtil.isStringAvailable(ts.getShowKeys().get(0))) {
				firsttime = ts.getShowKeys().get(0);

			}
			if (StringUtil.isStringAvailable(ts.getShowKeys().get(1))) {
				secondtime = ts.getShowKeys().get(1);
			}
		}

		str[0] = taskstate;
		str[1] = firsttime;
		str[2] = secondtime;
		Log.e("Tool>>functioncode", functioncode);
		Log.e("Tool>>>typecode", task.getStatusType_typeCode());
		Log.e("Tool>>>typestate", taskstate);
		Log.e("Tool>>>firsttime", firsttime);
		Log.e("Tool>>>secondtime", secondtime);
		return str;

	}

	/**
	 * 找到对应InitTaskState
	 * 
	 * @param user
	 * @param task
	 * @param initprofuncs
	 * @param functioncode
	 * @param peopleType
	 * @return
	 */
	public static InitTaskState getInitTaskState(User user, Task task,
			List<InitProgressFunction> initprofuncs, String functioncode,
			String peopleType) {
		InitTaskState initts = new InitTaskState();
		InitProgressFunction initprofunc = new InitProgressFunction();
		boolean isReporter = isReporter(task, user.getUserId(), peopleType);
		String functionPeopleType = getFunctionPeopleType(functioncode,
				peopleType, isReporter);
		// 找到对应的function
		for (int i = 0; i < Config.PEOPLE_TYPE_ARR.length; i++) {
			for (int j = 0; j < initprofuncs.size(); j++) {
				if (StringUtil.isStringEqual(functionPeopleType,
						Config.PEOPLE_TYPE_ARR[i])) {
					if (StringUtil.isStringEqual(initprofuncs.get(j)
							.getProgressFunction(),
							Config.FUNC_PEOPLE_TYPE_ARR[i])) {
						initprofunc = initprofuncs.get(j);
					}
				}
			}

		}

		// 找到对应InitTaskState
		for (InitTaskState ts : initprofunc.getStatus()) {
			if (StringUtil.isStringEqual(task.getStatusType_typeCode(),
					ts.getStatusType_typeCode())) {
				initts = ts;
			}
		}
		return initts;
	}

	/**
	 * 找到对应的InitProgressFunction
	 * 
	 * @param user
	 * @param task
	 * @param initprofuncs
	 * @param functioncode
	 * @param peopleType
	 * @return
	 */
	public static InitProgressFunction getInitProgressFunction(User user,
			Task task, List<InitProgressFunction> initprofuncs,
			String functioncode, String peopleType) {
		InitProgressFunction initprofunc = new InitProgressFunction();
		boolean isReporter = isReporter(task, user.getUserId(), peopleType);
		String functionPeopleType = getFunctionPeopleType(functioncode,
				peopleType, isReporter);
		// 找到对应的function
		for (int i = 0; i < Config.PEOPLE_TYPE_ARR.length; i++) {
			for (int j = 0; j < initprofuncs.size(); j++) {
				if (StringUtil.isStringEqual(functionPeopleType,
						Config.PEOPLE_TYPE_ARR[i])) {
					if (StringUtil.isStringEqual(initprofuncs.get(j)
							.getProgressFunction(),
							Config.FUNC_PEOPLE_TYPE_ARR[i])) {
						initprofunc = initprofuncs.get(j);
					}
				}
			}

		}

		return initprofunc;
	}

	public static String judgeHouseType(String housetype, String code,
			String value) {
		String realip = "";
		if (housetype.equals("residence")) {
			if (code.indexOf("_r") > -1) { // 包含住宅
				realip = value;
			}
		} else if (housetype.equals("business")) {
			if (code.indexOf("_b") > -1) { // 包含商业
				realip = value;
			}
		}
		return realip;
	}

	public static String getConfigUrl(String str1, String str2) {
		return str1 + str2;
	}
}
